package com.coconet.gas.config;
 
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.async.DeferredResult;

import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;

@Configuration
public class SwaggerConfig {
	
	
	@Bean
    public Docket demoApi() {
        return new Docket(DocumentationType.SWAGGER_2)
                .groupName("demo")
                .genericModelSubstitutes(DeferredResult.class)
//              .genericModelSubstitutes(ResponseEntity.class)
                .useDefaultResponseMessages(false)
                .forCodeGeneration(false)
                .pathMapping("/")
                .select()
                .apis(RequestHandlerSelectors.basePackage("com.coconet.ifms.rest"))//过滤的接口
                .build()
                .apiInfo(demoApiInfo());
    }
	

 
    private ApiInfo demoApiInfo() {
    
        ApiInfo apiInfo = new ApiInfo("IFMS-DW相关接口",//大标题
                "IFMS-DW相关接口，获取个数，获取列表，注意：",//小标题
                "1.0",//版本
                "是是是",
                "CJD",//作者
                "IFMS",//链接显示文字
                "WWW.COCONET.COM"//网站链接
        );
 
        return apiInfo;
    }
}